<template>
  <div  >
    
      <form @submit='from_Submit' >
		  <view class="uni-title uni-common-pl">输入</view>
		<textarea class="textarea" v-model="text_msg" placeholder="输入要翻译的内容！"></textarea>
     <!--   <select v-model="language" >
          <option value="en">English</option>
          <option value="ru">Russian</option>
          <option value="ko">Korean</option>
          <option value="ja">japanese</option>
        </select> -->
		<picker class="picker" @change="bindPickerChange" :value="type" :range="typeArray">
			<view class="uni-input">{{typeArray[type]}}</view>
		</picker>
        <!-- <input type='submit' value='翻译' > -->
		<button @click="from_Submit">翻译</button>
      </form>
    
  </div>
</template>

<script>
export default {
  name: 'fromin',
  data () {
    return {
		type: 0,
		typeArray:['en','ja'],
      text_msg: '',
      language:"en"
    }
  },
  methods:{
	  bindPickerChange: function(e) {
	  	console.log('picker发送选择改变，携带值为', e.target.value)
	  	this.type = e.target.value
	  },
    from_Submit:function(e){
      e.preventDefault();
      //alert(this.text_msg);      
      this.$emit("fy_text",this.text_msg,this.language);
            

    }
  }
}
</script>

<!-- Add "scoped" attribute to limit CSS to this component only -->
<style scoped>

</style>
